package com.ms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ms.domain.entity.Genre;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GenreMapper extends BaseMapper<Genre> {

    // 获取所有分类（按类型排序）
    @Select("SELECT * FROM genre ORDER BY FIELD(type, 'MAIN','SUB','SUBTYPE'), name")
    List<Genre> selectAllSorted();
}
